package com.iwhalecloud.uncc.web.service;

import com.iwhalecloud.uncc.archiver.impl.InsCollectServerArchiver;
import com.iwhalecloud.uncc.archiver.impl.InsCollectServiceArchiver;
import com.iwhalecloud.uncc.archiver.impl.InsCollectTaskArchiver;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author zq
 * @date 2021/10/18 15:54
 * @description InstantService
 */
@Service
@Slf4j
public class InstantService implements WebService{

    @Override
    public boolean archiveAll() {
        this.archiveInsCollectTask();
        this.archiveInsCollectService();
        this.archiveInsCollectServer();
        return true;
    }

    @Override
    public boolean archiveInsCollectTask() {
        InsCollectTaskArchiver insCollectTaskArchiver = new InsCollectTaskArchiver();
        insCollectTaskArchiver.archive();
        return true;
    }

    @Override
    public boolean archiveInsCollectService() {
        InsCollectServiceArchiver insCollectServiceArchiver = new InsCollectServiceArchiver();
        insCollectServiceArchiver.archive();
        return true;
    }

    @Override
    public boolean archiveInsCollectServer() {
        InsCollectServerArchiver insCollectServerArchiver = new InsCollectServerArchiver();
        insCollectServerArchiver.archive();
        return true;
    }
}
